3.199 \(\int \frac{\sec (e+f x) (a+a \sec (e+f x))^2}{(c+d \sec (e+f x))^3} \, dx\)

Optimal. Leaf size=130 \[ \frac{3 a^2 \tanh ^{-1}\left (\frac{\sqrt{c-d} \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c+d}}\right )}{f \sqrt{c-d} (c+d)^{5/2}}+\frac{3 a^2 \tan (e+f x)}{2 f (c+d)^2 (c+d \sec (e+f x))}+\frac{\tan (e+f x) \left (a^2 \sec (e+f x)+a^2\right )}{2 f (c+d) (c+d \sec (e+f x))^2} \]

[Out]

(3*a^2*ArcTanh[(Sqrt[c - d]*Tan[(e + f*x)/2])/Sqrt[c + d]])/(Sqrt[c - d]*(c + d)^(5/2)*f) + ((a^2 + a^2*Sec[e
+ f*x])*Tan[e + f*x])/(2*(c + d)*f*(c + d*Sec[e + f*x])^2) + (3*a^2*Tan[e + f*x])/(2*(c + d)^2*f*(c + d*Sec[e
+ f*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.196767, antiderivative size = 184, normalized size of antiderivative = 1.42, number of steps used = 5, number of rules used = 4, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.129, Rules used = {3987, 94, 93, 205} \[ -\frac{3 a^3 \tan (e+f x) \tan ^{-1}\left (\frac{\sqrt{c+d} \sqrt{a \sec (e+f x)+a}}{\sqrt{c-d} \sqrt{a-a \sec (e+f x)}}\right )}{f \sqrt{c-d} (c+d)^{5/2} \sqrt{a-a \sec (e+f x)} \sqrt{a \sec (e+f x)+a}}+\frac{3 a^2 \tan (e+f x)}{2 f (c+d)^2 (c+d \sec (e+f x))}+\frac{\tan (e+f x) \left (a^2 \sec (e+f x)+a^2\right )}{2 f (c+d) (c+d \sec (e+f x))^2} \]

Antiderivative was successfully verified.

[In]

Int[(Sec[e + f*x]*(a + a*Sec[e + f*x])^2)/(c + d*Sec[e + f*x])^3,x]

[Out]

(-3*a^3*ArcTan[(Sqrt[c + d]*Sqrt[a + a*Sec[e + f*x]])/(Sqrt[c - d]*Sqrt[a - a*Sec[e + f*x]])]*Tan[e + f*x])/(S
qrt[c - d]*(c + d)^(5/2)*f*Sqrt[a - a*Sec[e + f*x]]*Sqrt[a + a*Sec[e + f*x]]) + ((a^2 + a^2*Sec[e + f*x])*Tan[
e + f*x])/(2*(c + d)*f*(c + d*Sec[e + f*x])^2) + (3*a^2*Tan[e + f*x])/(2*(c + d)^2*f*(c + d*Sec[e + f*x]))

Rule 3987

Int[(csc[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]
*(d_.) + (c_))^(n_), x_Symbol] :> Dist[(a^2*g*Cot[e + f*x])/(f*Sqrt[a + b*Csc[e + f*x]]*Sqrt[a - b*Csc[e + f*x
]]), Subst[Int[((g*x)^(p - 1)*(a + b*x)^(m - 1/2)*(c + d*x)^n)/Sqrt[a - b*x], x], x, Csc[e + f*x]], x] /; Free
Q[{a, b, c, d, e, f, g, m, n, p}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && (EqQ[p,
 1] || IntegerQ[m - 1/2])

Rule 94

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[((a + b
*x)^(m + 1)*(c + d*x)^n*(e + f*x)^(p + 1))/((m + 1)*(b*e - a*f)), x] - Dist[(n*(d*e - c*f))/((m + 1)*(b*e - a*
f)), Int[(a + b*x)^(m + 1)*(c + d*x)^(n - 1)*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, m, p}, x] && EqQ[
m + n + p + 2, 0] && GtQ[n, 0] &&  !(SumSimplerQ[p, 1] &&  !SumSimplerQ[m, 1])

Rule 93

Int[(((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_))/((e_.) + (f_.)*(x_)), x_Symbol] :> With[{q = Denomin
ator[m]}, Dist[q, Subst[Int[x^(q*(m + 1) - 1)/(b*e - a*f - (d*e - c*f)*x^q), x], x, (a + b*x)^(1/q)/(c + d*x)^
(1/q)], x]] /; FreeQ[{a, b, c, d, e, f}, x] && EqQ[m + n + 1, 0] && RationalQ[n] && LtQ[-1, m, 0] && SimplerQ[
a + b*x, c + d*x]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{\sec (e+f x) (a+a \sec (e+f x))^2}{(c+d \sec (e+f x))^3} \, dx &=-\frac{\left (a^2 \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{(a+a x)^{3/2}}{\sqrt{a-a x} (c+d x)^3} \, dx,x,\sec (e+f x)\right )}{f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{\left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{2 (c+d) f (c+d \sec (e+f x))^2}-\frac{\left (3 a^3 \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{\sqrt{a+a x}}{\sqrt{a-a x} (c+d x)^2} \, dx,x,\sec (e+f x)\right )}{2 (c+d) f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{\left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{2 (c+d) f (c+d \sec (e+f x))^2}+\frac{3 a^2 \tan (e+f x)}{2 (c+d)^2 f (c+d \sec (e+f x))}-\frac{\left (3 a^4 \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{\sqrt{a-a x} \sqrt{a+a x} (c+d x)} \, dx,x,\sec (e+f x)\right )}{2 (c+d)^2 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{\left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{2 (c+d) f (c+d \sec (e+f x))^2}+\frac{3 a^2 \tan (e+f x)}{2 (c+d)^2 f (c+d \sec (e+f x))}-\frac{\left (3 a^4 \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{a c-a d-(-a c-a d) x^2} \, dx,x,\frac{\sqrt{a+a \sec (e+f x)}}{\sqrt{a-a \sec (e+f x)}}\right )}{(c+d)^2 f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=-\frac{3 a^3 \tan ^{-1}\left (\frac{\sqrt{c+d} \sqrt{a+a \sec (e+f x)}}{\sqrt{c-d} \sqrt{a-a \sec (e+f x)}}\right ) \tan (e+f x)}{\sqrt{c-d} (c+d)^{5/2} f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}+\frac{\left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{2 (c+d) f (c+d \sec (e+f x))^2}+\frac{3 a^2 \tan (e+f x)}{2 (c+d)^2 f (c+d \sec (e+f x))}\\ \end{align*}

Mathematica [C]  time = 1.16088, size = 249, normalized size = 1.92 \[ \frac{a^2 \sec ^4\left (\frac{1}{2} (e+f x)\right ) \sec (e+f x) (\sec (e+f x)+1)^2 (c \cos (e+f x)+d) \left (-\frac{6 i (\cos (e)-i \sin (e)) (c \cos (e+f x)+d)^2 \tan ^{-1}\left (\frac{(\sin (e)+i \cos (e)) \left (\tan \left (\frac{f x}{2}\right ) (c \cos (e)-d)+c \sin (e)\right )}{\sqrt{c^2-d^2} \sqrt{(\cos (e)-i \sin (e))^2}}\right )}{\sqrt{c^2-d^2} \sqrt{(\cos (e)-i \sin (e))^2}}+\frac{\sec (e) \left (\left (c^2-4 c d-2 d^2\right ) \sin (e)+c (4 c+d) \sin (f x)\right ) (c \cos (e+f x)+d)}{c^2}+\frac{(c-d) (c+d) \sec (e) (c \sin (f x)-d \sin (e))}{c^2}\right )}{8 f (c+d)^2 (c+d \sec (e+f x))^3} \]

Antiderivative was successfully verified.

[In]

Integrate[(Sec[e + f*x]*(a + a*Sec[e + f*x])^2)/(c + d*Sec[e + f*x])^3,x]

[Out]

(a^2*(d + c*Cos[e + f*x])*Sec[(e + f*x)/2]^4*Sec[e + f*x]*(1 + Sec[e + f*x])^2*(((-6*I)*ArcTan[((I*Cos[e] + Si
n[e])*(c*Sin[e] + (-d + c*Cos[e])*Tan[(f*x)/2]))/(Sqrt[c^2 - d^2]*Sqrt[(Cos[e] - I*Sin[e])^2])]*(d + c*Cos[e +
 f*x])^2*(Cos[e] - I*Sin[e]))/(Sqrt[c^2 - d^2]*Sqrt[(Cos[e] - I*Sin[e])^2]) + ((c - d)*(c + d)*Sec[e]*(-(d*Sin
[e]) + c*Sin[f*x]))/c^2 + ((d + c*Cos[e + f*x])*Sec[e]*((c^2 - 4*c*d - 2*d^2)*Sin[e] + c*(4*c + d)*Sin[f*x]))/
c^2))/(8*(c + d)^2*f*(c + d*Sec[e + f*x])^3)

________________________________________________________________________________________

Maple [A]  time = 0.107, size = 167, normalized size = 1.3 \begin{align*} 8\,{\frac{{a}^{2}}{f} \left ( 1/4\,{\frac{\tan \left ( 1/2\,fx+e/2 \right ) }{ \left ( c+d \right ) \left ( \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2}c- \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2}d-c-d \right ) ^{2}}}+3/4\,{\frac{1}{c+d} \left ( -1/2\,{\frac{\tan \left ( 1/2\,fx+e/2 \right ) }{ \left ( c+d \right ) \left ( \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2}c- \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2}d-c-d \right ) }}+1/2\,{\frac{1}{ \left ( c+d \right ) \sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}{\it Artanh} \left ({\frac{\tan \left ( 1/2\,fx+e/2 \right ) \left ( c-d \right ) }{\sqrt{ \left ( c+d \right ) \left ( c-d \right ) }}} \right ) } \right ) } \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(f*x+e)*(a+a*sec(f*x+e))^2/(c+d*sec(f*x+e))^3,x)

[Out]

8/f*a^2*(1/4*tan(1/2*f*x+1/2*e)/(c+d)/(tan(1/2*f*x+1/2*e)^2*c-tan(1/2*f*x+1/2*e)^2*d-c-d)^2+3/4/(c+d)*(-1/2*ta
n(1/2*f*x+1/2*e)/(c+d)/(tan(1/2*f*x+1/2*e)^2*c-tan(1/2*f*x+1/2*e)^2*d-c-d)+1/2/(c+d)/((c+d)*(c-d))^(1/2)*arcta
nh(tan(1/2*f*x+1/2*e)*(c-d)/((c+d)*(c-d))^(1/2))))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^2/(c+d*sec(f*x+e))^3,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 0.561703, size = 1339, normalized size = 10.3 \begin{align*} \left [\frac{3 \,{\left (a^{2} c^{2} \cos \left (f x + e\right )^{2} + 2 \, a^{2} c d \cos \left (f x + e\right ) + a^{2} d^{2}\right )} \sqrt{c^{2} - d^{2}} \log \left (\frac{2 \, c d \cos \left (f x + e\right ) -{\left (c^{2} - 2 \, d^{2}\right )} \cos \left (f x + e\right )^{2} + 2 \, \sqrt{c^{2} - d^{2}}{\left (d \cos \left (f x + e\right ) + c\right )} \sin \left (f x + e\right ) + 2 \, c^{2} - d^{2}}{c^{2} \cos \left (f x + e\right )^{2} + 2 \, c d \cos \left (f x + e\right ) + d^{2}}\right ) + 2 \,{\left (a^{2} c^{3} + 4 \, a^{2} c^{2} d - a^{2} c d^{2} - 4 \, a^{2} d^{3} +{\left (4 \, a^{2} c^{3} + a^{2} c^{2} d - 4 \, a^{2} c d^{2} - a^{2} d^{3}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{4 \,{\left ({\left (c^{6} + 2 \, c^{5} d - 2 \, c^{3} d^{3} - c^{2} d^{4}\right )} f \cos \left (f x + e\right )^{2} + 2 \,{\left (c^{5} d + 2 \, c^{4} d^{2} - 2 \, c^{2} d^{4} - c d^{5}\right )} f \cos \left (f x + e\right ) +{\left (c^{4} d^{2} + 2 \, c^{3} d^{3} - 2 \, c d^{5} - d^{6}\right )} f\right )}}, \frac{3 \,{\left (a^{2} c^{2} \cos \left (f x + e\right )^{2} + 2 \, a^{2} c d \cos \left (f x + e\right ) + a^{2} d^{2}\right )} \sqrt{-c^{2} + d^{2}} \arctan \left (-\frac{\sqrt{-c^{2} + d^{2}}{\left (d \cos \left (f x + e\right ) + c\right )}}{{\left (c^{2} - d^{2}\right )} \sin \left (f x + e\right )}\right ) +{\left (a^{2} c^{3} + 4 \, a^{2} c^{2} d - a^{2} c d^{2} - 4 \, a^{2} d^{3} +{\left (4 \, a^{2} c^{3} + a^{2} c^{2} d - 4 \, a^{2} c d^{2} - a^{2} d^{3}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{2 \,{\left ({\left (c^{6} + 2 \, c^{5} d - 2 \, c^{3} d^{3} - c^{2} d^{4}\right )} f \cos \left (f x + e\right )^{2} + 2 \,{\left (c^{5} d + 2 \, c^{4} d^{2} - 2 \, c^{2} d^{4} - c d^{5}\right )} f \cos \left (f x + e\right ) +{\left (c^{4} d^{2} + 2 \, c^{3} d^{3} - 2 \, c d^{5} - d^{6}\right )} f\right )}}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^2/(c+d*sec(f*x+e))^3,x, algorithm="fricas")

[Out]

[1/4*(3*(a^2*c^2*cos(f*x + e)^2 + 2*a^2*c*d*cos(f*x + e) + a^2*d^2)*sqrt(c^2 - d^2)*log((2*c*d*cos(f*x + e) -
(c^2 - 2*d^2)*cos(f*x + e)^2 + 2*sqrt(c^2 - d^2)*(d*cos(f*x + e) + c)*sin(f*x + e) + 2*c^2 - d^2)/(c^2*cos(f*x
 + e)^2 + 2*c*d*cos(f*x + e) + d^2)) + 2*(a^2*c^3 + 4*a^2*c^2*d - a^2*c*d^2 - 4*a^2*d^3 + (4*a^2*c^3 + a^2*c^2
*d - 4*a^2*c*d^2 - a^2*d^3)*cos(f*x + e))*sin(f*x + e))/((c^6 + 2*c^5*d - 2*c^3*d^3 - c^2*d^4)*f*cos(f*x + e)^
2 + 2*(c^5*d + 2*c^4*d^2 - 2*c^2*d^4 - c*d^5)*f*cos(f*x + e) + (c^4*d^2 + 2*c^3*d^3 - 2*c*d^5 - d^6)*f), 1/2*(
3*(a^2*c^2*cos(f*x + e)^2 + 2*a^2*c*d*cos(f*x + e) + a^2*d^2)*sqrt(-c^2 + d^2)*arctan(-sqrt(-c^2 + d^2)*(d*cos
(f*x + e) + c)/((c^2 - d^2)*sin(f*x + e))) + (a^2*c^3 + 4*a^2*c^2*d - a^2*c*d^2 - 4*a^2*d^3 + (4*a^2*c^3 + a^2
*c^2*d - 4*a^2*c*d^2 - a^2*d^3)*cos(f*x + e))*sin(f*x + e))/((c^6 + 2*c^5*d - 2*c^3*d^3 - c^2*d^4)*f*cos(f*x +
 e)^2 + 2*(c^5*d + 2*c^4*d^2 - 2*c^2*d^4 - c*d^5)*f*cos(f*x + e) + (c^4*d^2 + 2*c^3*d^3 - 2*c*d^5 - d^6)*f)]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} a^{2} \left (\int \frac{\sec{\left (e + f x \right )}}{c^{3} + 3 c^{2} d \sec{\left (e + f x \right )} + 3 c d^{2} \sec ^{2}{\left (e + f x \right )} + d^{3} \sec ^{3}{\left (e + f x \right )}}\, dx + \int \frac{2 \sec ^{2}{\left (e + f x \right )}}{c^{3} + 3 c^{2} d \sec{\left (e + f x \right )} + 3 c d^{2} \sec ^{2}{\left (e + f x \right )} + d^{3} \sec ^{3}{\left (e + f x \right )}}\, dx + \int \frac{\sec ^{3}{\left (e + f x \right )}}{c^{3} + 3 c^{2} d \sec{\left (e + f x \right )} + 3 c d^{2} \sec ^{2}{\left (e + f x \right )} + d^{3} \sec ^{3}{\left (e + f x \right )}}\, dx\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))**2/(c+d*sec(f*x+e))**3,x)

[Out]

a**2*(Integral(sec(e + f*x)/(c**3 + 3*c**2*d*sec(e + f*x) + 3*c*d**2*sec(e + f*x)**2 + d**3*sec(e + f*x)**3),
x) + Integral(2*sec(e + f*x)**2/(c**3 + 3*c**2*d*sec(e + f*x) + 3*c*d**2*sec(e + f*x)**2 + d**3*sec(e + f*x)**
3), x) + Integral(sec(e + f*x)**3/(c**3 + 3*c**2*d*sec(e + f*x) + 3*c*d**2*sec(e + f*x)**2 + d**3*sec(e + f*x)
**3), x))

________________________________________________________________________________________

Giac [A]  time = 1.36723, size = 297, normalized size = 2.28 \begin{align*} -\frac{\frac{3 \,{\left (\pi \left \lfloor \frac{f x + e}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (2 \, c - 2 \, d\right ) + \arctan \left (\frac{c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}{\sqrt{-c^{2} + d^{2}}}\right )\right )} a^{2}}{{\left (c^{2} + 2 \, c d + d^{2}\right )} \sqrt{-c^{2} + d^{2}}} + \frac{3 \, a^{2} c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 3 \, a^{2} d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 5 \, a^{2} c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 5 \, a^{2} d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )}{{\left (c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - c - d\right )}^{2}{\left (c^{2} + 2 \, c d + d^{2}\right )}}}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^2/(c+d*sec(f*x+e))^3,x, algorithm="giac")

[Out]

-(3*(pi*floor(1/2*(f*x + e)/pi + 1/2)*sgn(2*c - 2*d) + arctan((c*tan(1/2*f*x + 1/2*e) - d*tan(1/2*f*x + 1/2*e)
)/sqrt(-c^2 + d^2)))*a^2/((c^2 + 2*c*d + d^2)*sqrt(-c^2 + d^2)) + (3*a^2*c*tan(1/2*f*x + 1/2*e)^3 - 3*a^2*d*ta
n(1/2*f*x + 1/2*e)^3 - 5*a^2*c*tan(1/2*f*x + 1/2*e) - 5*a^2*d*tan(1/2*f*x + 1/2*e))/((c*tan(1/2*f*x + 1/2*e)^2
 - d*tan(1/2*f*x + 1/2*e)^2 - c - d)^2*(c^2 + 2*c*d + d^2)))/f